package pack0923;
//冒泡排序法//
import java.util.Arrays;

public class DemoF {
    public static void main(String[] args) {
        int len = (int) (Math.random() * 20 + 10);
        int[] array = new int[len];
        for (int i = 0; i < len; i++) {
            array[i] = (int) (Math.random() * 100 + 41);
        }
        System.out.println(Arrays.toString(array));
        for (int j = 0; j < array.length - 1; j++) {


            for (int i = 0; i < array.length - 1 - j; i++) {
                if (array[i] > array[i + 1]) {
                    int c = array[i];
                    array[i] = array[i + 1];
                    array[i + 1] = c;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}